package com.tangula.web.kashine.entity;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

public class PagableForm implements Form{
	private int index;
	private int size;
	private String condition;
	public PagableForm() {
		super();

	}
	public PagableForm(int index, int size, String condition) {
		super();
		this.index = index;
		this.size = size;
		this.condition = condition;
	}
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public String getCondition() {
		return condition;
	}
	public void setCondition(String condition) {
		this.condition = condition;
	}

	
	public PageRequest toPageRequest(Sort.Order ... orders) {
		return PageRequest.of(index - 1,size,
				Sort.by(orders));
	}
	
	
}
